import { computed } from "vue";
import { useWindowSize } from "@vueuse/core";
// 判断设备类型
export function useDevice(breakpoint = 768) {
  const { width } = useWindowSize();

  const isMobile = computed(() => width.value < breakpoint);
  const isDesktop = computed(() => width.value >= breakpoint);

  return {
    isMobile,
    isDesktop,
    width,
  };
}